package org.drushpal.service.connecter
{
	import flash.events.IEventDispatcher;
	import flash.events.NativeProcessExitEvent;
	import flash.events.ProgressEvent;
	
	import org.drushpal.model.vo.Connection;

	public class SSH extends Connecter
	{		
		public function SSH(onError:Function,onComplete:Function,disp:IEventDispatcher)
		{
			super(onError,onComplete,disp);
		}
		
		
		override protected function execute(cmd:String,completeEvent:String):void{
		}
		
		public function onExit(e:NativeProcessExitEvent):void{
			trace(e.exitCode);
		}
		public function onOutput(e:ProgressEvent):void{
			var out:String = "";
			if(process.running) out = process.standardOutput.readUTFBytes(process.standardOutput.bytesAvailable);		
			out = out.split("\r").join("");
			trace(out);
		}
		public function onProcessError(e:ProgressEvent):void{
			trace(process.standardOutput.readUTFBytes(process.standardOutput.bytesAvailable));
		}
	}
}